5.3 Spatial intersections

5.3.1 Clip operation

## Reading layer `Haltestelle_Bahn_CH' from data source `C:\Users\bako\Desktop\Projekte\All_thing_R_Spatial\github\spatialR_for_ArcGIS_Users\sample_data\other\Haltestelle_Bahn_CH.shp' using driver `ESRI Shapefile'
## Simple feature collection with 3134 features and 16 fields
## geometry type:  POINT
## dimension:      XYZ
## bbox:           xmin: 2488908 ymin: 1076850 xmax: 2817389 ymax: 1289090
## z_range:        zmin: 194.905 zmax: 3453.525
## projected CRS:  CH1903+ / LV95
## Reading layer `Kantonsgebiet' from data source `C:\Users\bako\Desktop\Projekte\All_thing_R_Spatial\github\spatialR_for_ArcGIS_Users\sample_data\other\Kantonsgebiet.shp' using driver `ESRI Shapefile'
## Simple feature collection with 51 features and 22 fields
## geometry type:  POLYGON
## dimension:      XYZ
## bbox:           xmin: 2485410 ymin: 1075268 xmax: 2833858 ymax: 1295934
## z_range:        zmin: 193.51 zmax: 4613.729
## projected CRS:  CH1903+ / LV95

We want now to analyse the situation at a particular area. So we are going to create an index with the specific cantons we are interested in.

Plot the result from the clipping operation

So, ultimately, as we can see above, the st_intersection function creates a datasets where the point dataset is precisely “clipped” based on the area of interest.